/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity.tx;

import entity.establishment.Stakeholder;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;

/**
 *
 * @author AdminNUS
 */
@Entity
public class Advertisement implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String tags;
    private String filePath;
    private String description;
    private String link;
    private boolean isSubscription;
    private boolean isImpression;
    private boolean isClick;
    private Double biddingPrice;
    private boolean isActivated;
    private Double maxDailyClicksAmount;
    private Double maxDailyImpressionAmount;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date startDate;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date endDate;
    @ManyToOne
    private Stakeholder stakeholder;
    @OneToMany(cascade = {CascadeType.PERSIST})
    private List<AdvertisementStatistics> AdvertisementStatistics;
    private Integer totalClicks;
    private Integer totalImpression;
    private Double costPerClick;
    private String title;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the filePath
     */
    public String getFilePath() {
        return filePath;
    }

    /**
     * @param filePath the filePath to set
     */
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the link
     */
    public String getLink() {
        return link;
    }

    /**
     * @param link the link to set
     */
    public void setLink(String link) {
        this.link = link;
    }

    /**
     * @return the isSubscription
     */
    public boolean isIsSubscription() {
        return isSubscription;
    }

    /**
     * @param isSubscription the isSubscription to set
     */
    public void setIsSubscription(boolean isSubscription) {
        this.isSubscription = isSubscription;
    }

    /**
     * @return the isImpression
     */
    public boolean isIsImpression() {
        return isImpression;
    }

    /**
     * @param isImpression the isImpression to set
     */
    public void setIsImpression(boolean isImpression) {
        this.isImpression = isImpression;
    }

    /**
     * @return the biddingPrice
     */
    public Double getBiddingPrice() {
        return biddingPrice;
    }

    /**
     * @param biddingPrice the biddingPrice to set
     */
    public void setBiddingPrice(Double biddingPrice) {
        this.biddingPrice = biddingPrice;
    }

    /**
     * @return the isActivated
     */
    public boolean isIsActivated() {
        return isActivated;
    }

    /**
     * @param isActivated the isActivated to set
     */
    public void setIsActivated(boolean isActivated) {
        this.isActivated = isActivated;
    }

    /**
     * @return the stakeholder
     */
    public Stakeholder getStakeholder() {
        return stakeholder;
    }

    /**
     * @param stakeholder the stakeholder to set
     */
    public void setStakeholder(Stakeholder stakeholder) {
        this.stakeholder = stakeholder;
    }

    /**
     * @return the tags
     */
    public String getTags() {
        return tags;
    }

    /**
     * @param tags the tags to set
     */
    public void setTags(String tags) {
        this.tags = tags;
    }

    /**
     * @return the maxDailyClicksAmount
     */
    public Double getMaxDailyClicksAmount() {
        return maxDailyClicksAmount;
    }

    /**
     * @param maxDailyClicksAmount the maxDailyClicksAmount to set
     */
    public void setMaxDailyClicksAmount(Double maxDailyClicksAmount) {
        this.maxDailyClicksAmount = maxDailyClicksAmount;
    }

    /**
     * @return the maxDailyImpressionAmount
     */
    public Double getMaxDailyImpressionAmount() {
        return maxDailyImpressionAmount;
    }

    /**
     * @param maxDailyImpressionAmount the maxDailyImpressionAmount to set
     */
    public void setMaxDailyImpressionAmount(Double maxDailyImpressionAmount) {
        this.maxDailyImpressionAmount = maxDailyImpressionAmount;
    }

    /**
     * @return the startDate
     */
    public Date getStartDate() {
        return startDate;
    }

    /**
     * @param startDate the startDate to set
     */
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    /**
     * @return the endDate
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * @param endDate the endDate to set
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    /**
     * @return the isClick
     */
    public boolean isIsClick() {
        return isClick;
    }

    /**
     * @param isClick the isClick to set
     */
    public void setIsClick(boolean isClick) {
        this.isClick = isClick;
    }

    
    /**
     * @return the totalClicks
     */
    public Integer getTotalClicks() {
        return totalClicks;
    }

    /**
     * @param totalClicks the totalClicks to set
     */
    public void setTotalClicks(Integer totalClicks) {
        this.totalClicks = totalClicks;
    }

    /**
     * @return the totalImpression
     */
    public Integer getTotalImpression() {
        return totalImpression;
    }

    /**
     * @param totalImpression the totalImpression to set
     */
    public void setTotalImpression(Integer totalImpression) {
        this.totalImpression = totalImpression;
    }

    /**
     * @return the AdvertisementStatistics
     */
    public List<AdvertisementStatistics> getAdvertisementStatistics() {
        return AdvertisementStatistics;
    }

    /**
     * @param AdvertisementStatistics the AdvertisementStatistics to set
     */
    public void setAdvertisementStatistics(List<AdvertisementStatistics> AdvertisementStatistics) {
        this.AdvertisementStatistics = AdvertisementStatistics;
    }
    
    /**
     * @return Increase Click Count By 1
     */
    public void incrementClickCount(){
        this.totalClicks++;
    }
    
        /**
     * @return Increase Impression Count By 1
     */
    public void incrementImpressionCount(){
        this.totalImpression++;
    }

    /**
     * @return the costPerClick
     */
    public Double getCostPerClick() {
        return costPerClick;
    }

    /**
     * @param costPerClick the costPerClick to set
     */
    public void setCostPerClick(Double costPerClick) {
        this.costPerClick = costPerClick;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }
}
